#pragma once
#include "../../logger.h"

NAMESPACE_BEG

static std::string serilTimeToStr (const std::chrono::high_resolution_clock::time_point& time=std::chrono::high_resolution_clock::now())
{
	auto mil = std::chrono::duration_cast<std::chrono::milliseconds>(time.time_since_epoch()).count();
	auto sec = mil / 1000;
	auto time_stc = std::localtime (&sec);
	char buf[32] = { 0 };
	sprintf (buf, "%04d/%02d/%02d %02d:%02d:%02d:%03ld", time_stc->tm_year + 1900, time_stc->tm_mon + 1,time_stc->tm_mday, time_stc->tm_hour, time_stc->tm_min, time_stc->tm_sec, int(mil%1000));
	return buf;
}


static std::string getdDate(const std::chrono::high_resolution_clock::time_point&time=std::chrono::high_resolution_clock::now()) {
	char buf[32] = { 0 };
	auto mil = std::chrono::duration_cast<std::chrono::milliseconds>(time.time_since_epoch()).count();
	auto sec = mil / 1000;
	tm* t = std::localtime(&sec);
	sprintf(buf, "%04d/%02d/%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday);
	return buf;
}



NAMESPACE_END